package com.me.brainlessbirds.actors.survivors.units;

import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.utils.Timer.Task;
import com.me.brainlessbirds.Assets;
import com.me.brainlessbirds.actors.GameObject;
import com.me.brainlessbirds.actors.skills.BaseAttack;
import com.me.brainlessbirds.actors.survivors.Survivor;

public class Soldier extends Survivor
{
	public static final int	COST	= 30;

	public Soldier()
	{
		type = SurvivorType.SOLDIER;
		attack = 3.0f;
		defense = 4.0f;
		life = 3.0f;
		speed = 60.0f;
		incomeValue = 1;
		rgnIdle = new TextureRegion(Assets.get().textureSoldier);
		rgnAtk = new TextureRegion(Assets.get().textureSoldierAtk);

		setSize(64.0f, 64.0f);
		setOrigin(getWidth() / 2, getHeight() / 2);

		BaseAttack _bAttack = new BaseAttack(this.attack, 1f);
		_bAttack.setEffectTaskInit(new Task()
		{

			@Override
			public void run()
			{
				// TODO Auto-generated method stub
				//System.out.println("Base attack of SLD");
			}
		});
		this.skillMap.put(BaseAttack.class, _bAttack);
	}

	@Override
	public boolean collideLeft(GameObject _go)
	{
		boolean isColliding = super.collideLeft(_go);
		if (isColliding)
		{
			_go.OnHitBySoldier(this);
		}
		return isColliding;
	}
}
